<?php
	class hinhthucvaybs
	{
		// Các trường
		public $MaHinhThucVay = 0;
		public $TenHinhThucVay = "";
		public $LaiSuatVay = 0;
		
		// Các phương thức
		public function Them()
		{
			$db = new hinhthucvaydb();
			return $db->Them($this->TenHinhThucVay,
							 $this->LaiSuatVay);
		}
		
		public function CapNhat()
		{
			$db = new hinhthucvaydb();
			return $db->CapNhat($this->MaHinhThucVay, 
								$this->TenHinhThucVay,
								$this->LaiSuatVay);
		}
		
		public function Xoa()
		{
			$db = new hinhthucvaydb();
			return $db->Xoa($this->MaHinhThucVay);
		}
		
		public function XoaTatCa()
		{
			$db = new hinhthucvaydb();
			return $db->XoaTatCa();
		}
		
		public function TonTaiTrongKyHanTra()
		{
			$db = new hinhthucvaydb();
			return $db->TonTaiTrongKyHanTra($this->MaHinhThucVay);
		}
		
		public function LayDanhSach()
		{
			$db = new hinhthucvaydb();
			return $db->LayDanhSach($this->MaHinhThucVay,
									$this->TenHinhThucVay,
									$this->LaiSuatVay);
		}
	}
?>